[tox]
envlist=py{26,27,33,34,35,36,37}, go, lua

[testenv]
setenv =
  TRAVIS = {env:TRAVIS:}
commands =
  pip install numpy h5py
  pip install .
  python setup.py nosetests --verbosity=3

[testenv:go]
setenv =
  GOPATH = {env:HOME:}/gopath
  GOROOT = /usr/local/go
whitelist_externals=*
commands =
  mkdir -p {env:GOPATH:}/src/annoyindex
  wget https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz
  sudo tar -C /usr/local -xzf go1.5.linux-amd64.tar.gz
  sudo add-apt-repository -y ppa:timsc/swig-3.0.12
  sudo apt-get update -qq
  sudo apt-get install -y swig3.0
  swig3.0 -go -intgosize 64 -cgo -c++ src/annoygomodule.i
  cp src/annoygomodule_wrap.cxx src/annoyindex.go src/annoygomodule.h src/annoylib.h src/kissrandom.h {env:GOPATH:}/src/annoyindex
  {env:GOROOT}/bin/go build annoyindex

[testenv:lua]
setenv =
  HOME = {env:HOME}
whitelist_externals=*
commands =
  pip install hererocks
  hererocks {toxworkdir}/here --{env:LUA:} --luarocks 2.2
  {toxworkdir}/here/bin/luarocks make
  {toxworkdir}/here/bin/luarocks install busted
  {toxworkdir}/here/bin/busted test/annoy_test.lua
